<div id="main_content">
<?php echo form_open('carrinho/fechar_compra'); ?>

<?php if(isset($erro)) echo $erro;?>
<?php echo validation_errors(); ?>
    <table cellpadding="6" cellspacing="1" style="width:100%;font-size:13px">

<tr>
  <th width="10%">Quantidade</th>
  <th width="65%" style="text-align:left">Descrição</th>
  <th width="12%" style="text-align:right">Preço</th>
  <th width="13%" style="text-align:right">Sub total</th>
</tr>

<?php $i = 1; ?>

<?php foreach ($this->cart->contents() as $items): ?>

	<?php echo form_hidden("rowid[$i]", $items['rowid']); ?>

	<tr>
	  <td><center><?php echo $items['qty']; ?></center></td>
	  <td>
		<?php echo $items['name']; ?>

			<?php if ($this->cart->has_options($items['rowid']) == TRUE): ?>

				<p>
					<?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?>

						<strong><?php echo $option_name; ?>:</strong> <?php echo $option_value; ?><br />

					<?php endforeach; ?>
				</p>

			<?php endif; ?>

	  </td>
	  <td style="text-align:right"><?php echo 'R$'.$this->cart->format_number($items['price']); ?></td>
	  <td style="text-align:right">R$<?php echo $this->cart->format_number($items['subtotal']); ?></td>
	</tr>

<?php $i++; ?>

<?php endforeach; ?>

<tr>
  <td colspan="2"> </td>
  <td style="text-align:right"><strong>TOTAL</strong></td>
  <td style="text-align:right"><strong>R$<?php echo $this->cart->format_number($this->cart->total()); ?></strong></td>
</tr>

</table>

<p>Bandeira do cartão:</p>
<select name="bandeira" id="bandeira">
    <option value="0"></option>
    <option value="3">American Express</option>
    <option value="2">Mastercard</option>
    <option value="1">VISA</option>
</select>
<br />
<p>Número do cartão e código de segurança:</p>
<input class="login" type="text" size="15" style="width:140px" name="nro_cartao" id="nro_cartao" maxlength="16" value="<?php echo set_value('nro_cartao'); ?>" />
<input class="login" type="text" size="1" style="width:30px;margin-left: 5px" name="cod_seguranca" id="cod_seguranca" maxlength="3" value="<?php echo set_value('cod_seguranca'); ?>" />

<br/><br/><br/>
<p>Escolha o tipo de pagamento:</p>
<select name="nro_parcelas" id="nro_parcelas">
    <?php for($i=1;$i<=12;$i++):?>
	<option value="<?=$i?>"><?=$i?> parcela(s) de <?php printf("%.2f",$this->cart->total()/$i)?></option>
    <?php endfor;?>
</select>

<p><?php echo form_submit('', 'FINALIZAR COMPRA'); ?></p>